package com.ybwh.springboot2.sys.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageInfo;
import com.google.common.base.Preconditions;
import com.ybwh.springboot2.sys.dao.SysUserAccountMapper;
import com.ybwh.springboot2.sys.model.po.SysUserAccount;
import com.ybwh.springboot2.sys.service.SysUserAccountService;
import com.ybwh.springboot2.util.EntityUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.io.Serializable;
import java.util.Date;
import java.util.Collection;

/**
 * <p>
 * 账号表服务接口实现类
 * </p>
 *
 * @author Fan Beibei
 * @version V1.0
 * @since 2023-04-08 19:57:22
 */
@Slf4j
@Service
public class SysUserAccountServiceImpl implements SysUserAccountService {
    @Resource
    private SysUserAccountMapper sysUserAccountMapper;




    @Override
    public PageInfo<SysUserAccount> queryByPage(SysUserAccount param, int pageNum, int pageSize) {
        Preconditions.checkArgument(pageNum > 0);
        Preconditions.checkArgument(pageSize > 0);

        Page<SysUserAccount> page =  sysUserAccountMapper.selectByPage(param,pageNum,pageSize);

        return new PageInfo<>(page);
    }






//------------以上是生成代码-----------------------------------------------------------------------------------------------------------------

    @Override
    public SysUserAccount selectById(Long id) {
        return sysUserAccountMapper.getById(id);
    }


    @Override
    public SysUserAccount queryByAccount(String account) {

        return sysUserAccountMapper.selectByAccount(account);
    }




}
